package com.ycw.controller.CJY;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ycw.bean.Projects;
import com.ycw.service.CJY.ProjectAndTypeService;
import com.ycw.util.Msg;

@Controller
public class ProjectAndTypeController {

	@Autowired
	ProjectAndTypeService projectAndTypeService;
	//项目名称、项目发起人、项目状态、项目分类
		@RequestMapping("/getAllProjectAndType")
		@ResponseBody
		public Msg getAllProjectAndType(@RequestParam(value="page",defaultValue="1")Integer page,String psName,String usName,Integer psType,Integer pstId) {
			PageHelper.startPage(page, 10);
			List<Projects> list=projectAndTypeService.getAllProjectAndType(psName,usName,psType,pstId);
			//分页插件
			PageInfo pageInfo = new PageInfo(list);

			return Msg.success().add("pageInfo", pageInfo);
					
		}
}
